import Missile
import pygame

image1=pygame.image.load("bomb.bmp")
image1.set_colorkey((255,0,255))

class BasicBomb(Missile.Missile):
	def __init__(self,x=0,y=0,mass=16.3804815,image=image1):
		Missile.Missile.__init__(self,x=x,y=y,mass=mass,image=image)
		self.activated=False
		self.timer=100
	def hitResult(self):
		print 'no effect at this point'
		#self.cur_room.projectilesList.remove(self)
	def explode(self):
		self.cur_room.projectilesList.remove(self)
		import Blast
		blast=Blast.Blast(x=self.x,y=self.y)
		blast.cur_room=self.cur_room
		self.cur_room.projectilesList.append(blast)
	def attack(self,user):
		Missile.Missile.attack(self,user)
		self.activated=True
	def damageDealt(self,other):
		pass
	def postcondition(self):
		if self.activated:
			if self.timer==0:
				self.explode()
			else:
				self.timer=self.timer-1
	def canClimb(self,it):
		return False
	def bumping(self):
		eps=2.5
		return not (-eps<self.x-self.prev_x<eps and -eps<self.y-self.prev_y<eps) 
		#return True